package com.lmf.annotation.service;

import com.lmf.annotation.dao.MyDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MyService {
    private String name;

    public String getName() {
        return name;
    }

    public MyService() {
    }

    public MyService(String name, MyDao myDao) {
        this.name = name;
        this.myDao = myDao;
    }

    public MyService(String name) {
        this.name = name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public MyDao getMyDao() {
        return myDao;
    }

    public void setMyDao(MyDao myDao) {
        this.myDao = myDao;
    }

    @Autowired
    private MyDao myDao;

    public void print() {
        System.out.println(myDao);
    }

    @Override
    public String toString() {
        return "MyService{" +
                "name='" + name + '\'' +
                ", myDao=" + myDao +
                '}';
    }
}
